import {
	mapGetters
} from 'vuex'

export default {
	onShow() {
		this.setBadge()
	},
	methods: {
		setBadge() { //	增加tabbar上面的徽标
			uni.setTabBarBadge({
				index: 2,
				text: this.total + ''
			})
		}
	},
	computed: {
		...mapGetters('m_cart', ['total'])
	},
	watch: {
		total: {
			handler(newValue) {
				this.setBadge()
			},
		}
	}
}
